home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5707 < prev    next >
Encoding:
Text File  |  1996-08-05  |  975 b   |  28 lines

  1. Newsgroups: comp.lang.c
  2. Path: news.sprintlink.net!news1!news
  3. From: rclark@iquest.net (Robert B. Clark)
  4. Subject: Re: unique id for a string
  5. X-Nntp-Posting-Host: ind-004-236-169.iquest.net
  6. Message-ID: <3129dd39.961626@news.iquest.net>
  7. Followup-To: poster
  8. Sender: news@iquest.net (News Admin)
  9. Organization: IQuest Internet, Inc.
  10. X-Newsreader: Forte Agent .99d/16.182
  11. References: <1996Feb16.175601.114182@kuhub.cc.ukans.edu>
  12. Date: Tue, 20 Feb 1996 15:45:12 GMT
  13.  
  14. On 16 Feb 96 17:56:01 CST, anh@kuhub.cc.ukans.edu wrote:
  15.  
  16. >HELLO =  H * 26^4 + E * 26 ^3 +  L * 26^2 + L * 26^1 + E * 26^0
  17. >
  18. >But the id is way too big. I need something that fits within a 32-bits int 
  19. >or a 64-bits long.
  20.  
  21. You're thinking way too hard, perhaps.  Look up the algorithm for CRCs
  22. (cyclic redundancy checks/codes) in Snippets or most any other popular
  23. programmer's reference.
  24. --
  25. Robert B. Clark <rclark@iquest.net>
  26. "Be wary of strong spirits.  It can make you shoot at tax collectors...
  27. and miss." --RAH
  28.